<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body >
</body>
</html>






<#macro content>
	<!-- 添加文档信息div -->
	<div id="divpadd" class="easyui-window" title="添加文档信息" data-options="modal:true,collapsible:false,closed:true,minimizable:false,
		maximizable:false,width:800,onClose:divaddclose">
		<form id="topaddform" name="topaddform" method="post" action="${ctx}/sys/archives/add">
			<table class="table table-hover table-condensed">
				<tr>
					<td colspan="2">文章标题：<input name="title" id="addtitle" type="text" class="easyui-validatebox" value="" size="49" />
					<input type="hidden" name="id" id="addid" value="" />
					</td>
					<td colspan="2">文章短标题：<input name="shottitle" id="addshottitle" type="text" class="easyui-validatebox" value="" size="30"/></td>
				</tr>
				<tr>
					<td colspan="4">TAG标签：<input name="tag" id="addtag" type="text" class="easyui-validatebox" value="" size="49" />
					&nbsp;&nbsp;<span style="color: red;">(','号分开)</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					作者：<input name="author" id="addauthor" type="text" class="easyui-validatebox" value="" /></td>
				</tr>
				<tr>
					<td colspan="4">主&nbsp;&nbsp;栏&nbsp;&nbsp;目：
					<input type="text" id="zhucolname" name="zhucolname" class="easyui-validatebox" readonly="true" onclick="zhuTreeShow()" value="" />
					<input type="hidden" id="zhucolnameid" name="zhucolnameid" value="" />
					&nbsp;&nbsp;&nbsp;&nbsp;
					副&nbsp;&nbsp;栏&nbsp;&nbsp;目：
					<input type="text" id="fucolname" name="fucolname" class="easyui-validatebox" readonly="true" size="55"  onclick="fuTreeShow()" />
					<input type="hidden" id="fucolnameid" name="fucolnameid" value="" /></td>
				</tr>
				<tr>
					<td colspan="2" valign="top">文章来源：<input name="sourceurl" id="addsourceurl" type="text" class="easyui-validatebox" value="" size="49" /></td>
					<td valign="top">摘要：</td>
					<td valign="top"><textarea cols="35" name="summary" id="addsummary" rows="4"></textarea></td>
				</tr>
				<tr>
					<td colspan="4">缩&nbsp;&nbsp;略&nbsp;&nbsp;图：
					&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:void(0)" id="btn_microimg_upload" class="easyui-linkbutton" plain="true">本地上传</a>
					&nbsp;&nbsp;&nbsp;&nbsp;<a class="easyui-tooltip" data-options="hideEvent: 'none', content: function(){return jQuery('#img_show');}, onShow: function(){var t = jQuery(this); t.tooltip('tip').focus().unbind().bind('blur',function(){ t.tooltip('hide');});
                    }">查看缩略图</a>
                    <input type="hidden" name="microimgid" id="microimgid" value="" />&nbsp;&nbsp;&nbsp;&nbsp;
                    <!-- 图片集 -->
                    <a href="javascript:void(0)" class="easyui-linkbutton" id="btn_add_imagelist" plain="true">添加图片集合</a>
                    <input type="hidden" name="imglist" id="addimglist" value="" />&nbsp;&nbsp;&nbsp;&nbsp;
                    <input type="hidden" name="urlist" id="addurlist" value="" />
                    <a href="javascript:void(0)" class="easyui-linkbutton" id="btn_add_window_urlist" plain="true">添加URL集合</a>
					</td>
				</tr>
				<tr>
					<td colspan="4"><textarea name="htmlcontent" id="htmlcontent" cols="100" rows="16" style="width:775px;height:350px;visibility:hidden;"></textarea>
					<input type="hidden" id="addtextcontent" name="textcontent" value="" /></td>
				</tr>
				<tr>
					<td colspan="4" align="center"><a href="javascript:void(0)" class="easyui-linkbutton" id="btn_window_top_add" iconCls="icon-save" plain="true">保存</a></td>
				</tr>
			</table>
		</form>
	</div>
	
	<!-- 上传文件信息 -->
	<div id="add_window_microimg_upload" class="easyui-window" title="选择文件" data-options="modal:true,collapsible:false,closed:true,minimizable:false,maximizable:false,resizable:false">
		<form id="microimg_upload_form" action="${ctx}/sys/file/microimgupload" enctype="multipart/form-data" method="post">
			缩略图选择：<input type="file" id="microimg" name="microimg" value="" onchange="microimgfilter()" />
			<a href="javascript:void(0)" class="easyui-linkbutton" id="microimg_btn_upload" plain="true"">确认上传</a>
		</form>
	</div>
	
	<!-- 缩略图显示 -->
	<div style="display:none">
		<img id="img_show" alt="缩略图" src="" width="400px" />
	</div>
	<!-- 主栏目树选择 -->
	<div id="zhutreedialog" class="easyui-dialog" title="主栏目选择" data-options="closed:true" style="width:400px;height:200px;padding:10px">
		<ul id="zhutree" class="ztree" style="margin-top:0;width:347px;height:140px;"></ul>
	</div>
	<!-- 副栏目树选择 -->
	<div id="futreedialog" class="easyui-dialog" title="副栏目选择" data-options="closed:true" style="width:400px;height:200px;padding:10px">
		<ul id="futree" class="ztree" style="margin-top:0;width:347px;height:140px;"></ul>
	</div>
	<!-- 添加图片集合窗口 -->
	<div id="add_window_imagelist" class="easyui-dialog" title="图片集添加" data-options="closed:true,onClose:addwindowimagelistclose,width:930,height:550,onClose:divlistimgclose">
		<ul>
			<li>
				<a href="javascript:void(0)" class="easyui-linkbutton" id="btn_add_single_image" plain="true">添加图片</a>&nbsp;&nbsp;&nbsp;&nbsp;
				<a href="javascript:void(0)" class="easyui-linkbutton" id="btn_delete_single_image" plain="true">删除图片</a>&nbsp;&nbsp;&nbsp;&nbsp;
				<a href="javascript:void(0)" class="easyui-linkbutton" id="btn_add_single_image_ok" plain="true">确定</a>
			</li>
		</ul>
		<!-- 添加的图片信息 -->
		<div style="word-break:break-all; word-wrap:break-word; width:900px;">
			<ul id="ul_image"></ul>
		</div>
	</div>
	<!-- 图片集上传文件信息 -->
	<div id="add_window_list_microimg_upload" class="easyui-window" title="选择文件" data-options="modal:true,collapsible:false,closed:true,minimizable:false,maximizable:false,resizable:false">
		<form id="microimg_list_upload_form" action="${ctx}/sys/file/microimgupload" enctype="multipart/form-data" method="post">
			<table border="0">
				<tr>
					<td>缩略图选择：</td>
					<td><input type="file" id="list_microimg" name="microimg" value="" onchange="listimgfilter()" /></td>
				</tr>
				<tr>
					<td>图片描述：</td>
					<td></td>
				</tr>
				<tr>
					<td></td>
					<td><textarea cols="25" name="list_img_desc" id="addlist_img_desc" rows="4"></textarea></td>
				</tr>
				<tr>
					<td colspan="2" align="center"><a href="javascript:void(0)" class="easyui-linkbutton" id="list_microimg_btn_upload" plain="true"">确认上传</a></td>
				</tr>
			</table>
		</form>
	</div>
	<!-- 添加url集合窗口 -->
	<div id="add_window_urllist" class="easyui-dialog" title="URL集合添加" data-options="closed:true,onClose:addwindowimagelistclose,width:500,height:350">
		<ul>
			<li>
				<a href="javascript:void(0)" class="easyui-linkbutton" id="btn_add_url_ok" plain="true">确定添加</a>
			</li>
		</ul>
		<!-- 添加的URL集合 -->
		<div style="word-break:break-all; word-wrap:break-word; width:470px;">
			<ul id="ul_urlist"></ul>
		</div>
	</div>
	<script type="text/javascript">
	//副栏目树配置
	function initFuTreeSetting(){
		var cityObjid = jQuery("#fucolnameid");
		var param = cityObjid.attr("value");
		var fuSetting = {
			data: {
				simpleData: {
					enable: true
				}
			},
			check: {
				enable: true,
				chkboxType: {"Y":"", "N":""}
			},
			view: {
				dblClickExpand: false
			},
			data: {
				simpleData: {
					enable: true
				}
			},
			async: {
				enable: true,
				type:"post",
				otherParam:{"checked":param},
				url:"${ctx}/sys/column/zTreeAjax"
			},
			callback: {
				beforeClick:fubeforeClick,
				onCheck:fuonCheck
			}
		};
		return fuSetting;
	}
	//副栏目树显示事件
	function fuTreeShow(){
		jQuery.fn.zTree.init(jQuery("#futree"), initFuTreeSetting());
		jQuery("#futreedialog").dialog("open");
	}
	//副栏目节点点击之前的事件
	function fubeforeClick(treeId, treeNode) {
		var zTree = jQuery.fn.zTree.getZTreeObj("futree");
		zTree.checkNode(treeNode, !treeNode.checked, null, true);
		return false;
	}
	//副栏目节点选择的事件
	function fuonCheck(e, treeId, treeNode) {
		var zTree = jQuery.fn.zTree.getZTreeObj("futree"),
		nodes = zTree.getCheckedNodes(true),
		v = "";
		id = "";
		for (var i=0, l=nodes.length; i<l; i++) {
			v += nodes[i].name + ",";
			id += nodes[i].id + ",";
		}
		if (v.length > 0 ) v = v.substring(0, v.length-1);
		if (id.length > 0 ) id = id.substring(0, id.length-1);
		var cityObj = jQuery("#fucolname");
		cityObj.attr("value", v);
		var cityObjid = jQuery("#fucolnameid");
		cityObjid.attr("value", id);
	}
	//主栏目树配置
	function initZhuTreeSetting(){
		var cityObjid = jQuery("#zhucolnameid");
		var param = cityObjid.attr("value");
		var zhuSetting = {
			data: {
				simpleData: {
					enable: true
				}
			},
			check: {
				enable: true,
				chkStyle: "radio",
				radioType: "all"
			},
			view: {
				dblClickExpand: false
			},
			data: {
				simpleData: {
					enable: true
				}
			},
			async: {
				enable: true,
				type:"post",
				otherParam:{"checked":param},
				url:"${ctx}/sys/column/zTreeAjax"
			},
			callback: {
				onClick: zhuTreeonClick,
				onCheck: zhuTreeonCheck
			}
		};
		return zhuSetting;
	}
		//主栏目树显示事件
		function zhuTreeShow(){
			zhuTree = jQuery.fn.zTree.init(jQuery("#zhutree"), initZhuTreeSetting());
			jQuery("#zhutreedialog").dialog("open");
		}
		//主栏目树单击事件
		function zhuTreeonClick(e, treeId, treeNode) {
			var zTree = jQuery.fn.zTree.getZTreeObj("zhutree");
			zTree.checkNode(treeNode, !treeNode.checked, null, true);
			return false;
		}
		//主栏目树选择事件
		function zhuTreeonCheck(e, treeId, treeNode) {
			var zTree = jQuery.fn.zTree.getZTreeObj("zhutree"),
			nodes = zTree.getCheckedNodes(true),
			v = "";
			id = "";
			for (var i=0, l=nodes.length; i<l; i++) {
				v += nodes[i].name + ",";
				id += nodes[i].id + ",";
			}
			if (v.length > 0 ) v = v.substring(0, v.length-1);
			if (id.length > 0 ) id = id.substring(0, id.length-1);
			var cityObj = jQuery("#zhucolname");
			cityObj.attr("value", v);
			var cityObjid = jQuery("#zhucolnameid");
			cityObjid.attr("value", id);
			jQuery("#zhutreedialog").dialog("close");
		}
		//当添加窗体关闭事件
		function divaddclose(){
			jQuery("#zhutreedialog").dialog("close");
			jQuery("#futreedialog").dialog("close");
			jQuery("#add_window_microimg_upload").window("close");
			jQuery("#add_window_imagelist").window("close");
			jQuery("#add_window_list_microimg_upload").window("close");
			jQuery("#add_window_urllist").window("close");
		}
		//当上传图片集合按钮窗口关闭时的事件
		function divlistimgclose(){
			jQuery("#add_window_list_microimg_upload").window("close");
		}
		//当添加图片集合窗体关闭时的事件处理
		function addwindowimagelistclose(){
			jQuery("#add_window_microimg_upload").window("close");
		}
		//缩略图上传限制
		function microimgfilter(){
			return imgfileter("microimg");
		}
		//过滤图片
		function imgfileter(id){
			var file = document.getElementById(id);
			var fileName = file.value;
			var file_typename = fileName.substring(fileName.lastIndexOf('.'), fileName.length);
			if (!(file_typename == '.jpg'||file_typename == '.png')) {
				file.value="";
				jQuery.messager.alert("信息","请上传jpg与png格式的缩略图！");
				file.value="";
				return false;
			}
			return true;
		}
		//缩略图上传限制
		function listimgfilter(){
			return imgfileter("list_microimg");
		}
		//添加一个url文本框
		function addurlsingletext(){
			jQuery("#ul_urlist").append("<li><input type='text' size='45' class='urlsingletext' value='' /><input type='button' value='添加下一行' onclick='addurlsingletext()' /><input type='button' value='删除本行' onclick='deleteurlsingletext(this)' /></li>");//添加一个url文本信息
		}
		//删除一个url文本框
		function deleteurlsingletext(view){
			if(jQuery(".urlsingletext").length<2){
				jQuery.messager.alert("信息","最后一个不允许删除！");
				return;
			}
			var div = jQuery(view).parent();
			jQuery(div).remove();
		}
	</script>
</#macro>
<#macro js>
	var editor;
	KindEditor.ready(function(K) {
		editor = K.create('textarea[name="htmlcontent"]', {
			resizeType : 0,
			allowImageUpload : false,
			items : [
				"justifyleft","justifycenter","justifyright","justifyfull","|",
				"insertorderedlist","insertunorderedlist","|",
				"indent","outdent","|",
				"subscript","superscript","|",
				"formatblock","fontname","fontsize","|",
				"forecolor","hilitecolor","bold","italic","underline","strikethrough","removeformat","|",
				"table","hr","link","unlink","lineheight","anchor","|",
				"image","code","fullscreen","|","source"
			],
			
			cssPath : "${ctx}/js/kindeditor/plugins/code/prettify.css",
			uploadJson : "${ctx}/sys/file/kindeditorupload",
			fileManagerJson : "${ctx}/sys/file/kindeditormanager",
			afterCreate : function() {
				var self = this;
				K.ctrl(document, 13, function() {
					self.sync();
					document.forms["topaddform"].submit();
				});
				K.ctrl(self.edit.doc, 13, function() {
					self.sync();
					document.forms["topaddform"].submit();
				});
			}
		});
		prettyPrint();
	});
</#macro>